<template>
  <div class="paySuccess">
    <h3>{{seconds}}</h3>
    <h4>付款成功页面</h4>
    <router-link to="/" @click.native="backProductList">商品列表</router-link>
  </div>
</template>
<script>
  export default {
    name: 'PaySuccess',
    data () {
      return {
        n: null,
        seconds: 90
      }
    },

    created() {
        this.n = setInterval(() =>{
            this.seconds--;
            if(this.seconds === 0){
                clearInterval(this.n);
                this.$router.push('/');
            }
        }, 1000)
    },
    methods: {
      backProductList () {
          clearInterval(this.n);
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>


</style>
